package org.come.Frame;

import org.come.Jpanel.WxchangeAwardJpanel1;
import org.come.until.Music;
import org.come.until.MessagrFlagUntil;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import com.tool.tcpimg.UIUtils;
import javax.swing.plaf.basic.BasicInternalFrameUI;
import javax.swing.BorderFactory;
import java.awt.Component;
import org.come.until.FormsManagement;
import org.come.Jpanel.WxchangeAwardJpanel;
import java.awt.event.MouseListener;
import javax.swing.JInternalFrame;

public class WxchangeAwardJframe1 extends JInternalFrame implements MouseListener
{
    private WxchangeAwardJpanel1 wxchangeAwardJpanel1;
    private int first_x;
    private int first_y;

    public static WxchangeAwardJframe1 getExchangeAwardJframe() {
        return (WxchangeAwardJframe1)FormsManagement.getInternalForm(289).getFrame();
    }

    public WxchangeAwardJframe1() throws Exception {
        this.wxchangeAwardJpanel1 = new WxchangeAwardJpanel1();
        this.getContentPane().add((Component)this.wxchangeAwardJpanel1);
        this.setBorder(BorderFactory.createEmptyBorder());
        ((BasicInternalFrameUI)this.getUI()).setNorthPane(null);
        this.setBackground(UIUtils.Color_BACK);
        this.setBounds(0, 0, 0, 0);
        this.pack();
        this.setVisible(false);
        this.setDefaultCloseOperation(3);
        this.addMouseListener((MouseListener)this);
        this.addMouseMotionListener(new MouseMotionListener() {
            @Override
            public void mouseMoved(final MouseEvent e) {
                if (MessagrFlagUntil.ImgFlagImg.equals(MessagrFlagUntil.MOUSE13)) {
                    MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
                }
            }

            @Override
            public void mouseDragged(final MouseEvent e) {
                if (WxchangeAwardJframe1.this.isVisible()) {
                    final int x = e.getX() - WxchangeAwardJframe1.this.first_x;
                    final int y = e.getY() - WxchangeAwardJframe1.this.first_y;
                    WxchangeAwardJframe1.this.setBounds(x + WxchangeAwardJframe1.this.getX(), y + WxchangeAwardJframe1.this.getY(), WxchangeAwardJframe1.this.getWidth(), WxchangeAwardJframe1.this.getHeight());
                }
            }
        });
    }

    @Override
    public void mouseClicked(final MouseEvent e) {
    }

    @Override
    public void mousePressed(final MouseEvent e) {
        Music.addyinxiao("关闭窗口.mp3");
        if (e.isMetaDown()) {
            FormsManagement.HideForm(289);
        }
        else {
            FormsManagement.Switchinglevel(289);
        }
        this.first_x = e.getX();
        this.first_y = e.getY();
    }

    @Override
    public void mouseReleased(final MouseEvent e) {
    }

    @Override
    public void mouseEntered(final MouseEvent e) {
    }

    @Override
    public void mouseExited(final MouseEvent e) {
    }

    public WxchangeAwardJpanel1 getWxchangeAwardJpanel1() {
        return this.wxchangeAwardJpanel1;
    }

    public void setWxchangeAwardJpanel1(final WxchangeAwardJpanel1 wxchangeAwardJpanel1) {
        this.wxchangeAwardJpanel1 = wxchangeAwardJpanel1;
    }

    public int getFirst_x() {
        return this.first_x;
    }

    public void setFirst_x(final int first_x) {
        this.first_x = first_x;
    }

    public int getFirst_y() {
        return this.first_y;
    }

    public void setFirst_y(final int first_y) {
        this.first_y = first_y;
    }
}
